<?php
if (!empty($groups))
{
	foreach($groups as $group)
		{ ?>
		<tr>
		<td><?php echo $group['name']; ?></td>
		<td><?php if($group['default']) echo $html->image("check-success.png"); ?></td>
		<td><?php echo $group['prefix']; ?></td>
		<td><?php echo $group['suffix']; ?></td>
		<td><?php echo $group['build']; ?></td>
		<td>
		<?php
		if (!empty($group['inheritance']))
		{
			foreach($group['inheritance'] as $inheritance)
			{
				echo $inheritance."<br/>";
			}
		}
		?>
		</td>
		<td>
		<?php
		if (!empty($group['permissions']))
		{
			foreach($group['permissions'] as $permission)
			{
				echo $permission."<br/>";
			}
		}
		?>
		</td>
	<?php
	echo "<td><a class='ui-icon ui-icon-pencil' title='Edit' href='#' onclick='editmggroup(".json_encode(array($group['name'],$group['default'],$group['prefix'],$group['suffix'],$group['build'],$group['inheritance'],$group['permissions'])).");'></a></td>";
	echo "<td>".$js->link('Del',array('controller'=>'plugins','action'=>'delgmgroup'),array('htmlAttributes'=>array('title'=>'Delete','class'=>'ui-icon ui-icon-trash'),'update'=>'#plugins_showgmgroups','confirm'=>'Are you sure ?','data'=>'{world:$(\'#worldlist\').val(),group:\''.$group['name'].'\'}','method'=>'post','dataExpression'=>true))."</td>";
		?>
		</tr>
		<?php
	}
echo $this->Js->writeBuffer();
}
?>